/**
  ************************************* Copyright ******************************
  * FileName   : queue.h
  * Version    : v1.0
  * Author     : yychao
  * Date       : 2023-06-16
  * Description:
  * Function List:
  	1. ....
  	   <version>:
  <modify staff>:
  		  <data>:
   <description>:
  	2. ...
  ******************************************************************************
 */

#ifndef __QUEUE_H_
#define __QUEUE_H_

#include <main.h>

#define ringbuff_len	(2)
#define databuff_len	(512)
typedef struct {
    uint16_t len;
    uint8_t data[databuff_len];
} DataBuff;
typedef struct {
    uint8_t head;
    uint8_t tail;
    uint8_t lenght;
    uint8_t lock;
    DataBuff data_buff[ringbuff_len];
} RingBuff;
extern RingBuff usart1_buff;


extern RingBuff usart_buff;

void RingBuffIni(RingBuff *pbuff);
uint8_t Read_RingBuff(RingBuff *pbuff, DataBuff *rdata);
uint8_t Write_RingBuff(RingBuff *pbuff, uint8_t *wdata, uint16_t len);
uint8_t RingBuffRst(RingBuff *pbuff);



#endif



